#include "ObjectInterface.h"
#include "../../Render/TextureManager.h"


ObjectInterface::ObjectInterface(void)
{
	m_BasePositionX = 0;
	m_BasePositionY = 0;
}


ObjectInterface::~ObjectInterface(void)
{
}


void ObjectInterface::SetImageID(int ID)
{
	TextureManager *pTextureManager = TextureManager::GetInstance();

	m_ImageID = ID;

	if( m_ImageID > -1 )
	{
		m_ImageWidth = pTextureManager->GetTextureWidth(m_ImageID);
		m_ImageHeight = pTextureManager->GetTextureHeight(m_ImageID);
	}
	else
	{
		m_ImageWidth = 0;
		m_ImageHeight = 0;
	}
}

void ObjectInterface::SetX(int x)
{
	m_BasePositionX = (float)x;
}

void ObjectInterface::SetY(int y)
{
	m_BasePositionY = (float)y;
}

float ObjectInterface::GetX(void)
{
	return m_BasePositionX;
}

float ObjectInterface::GetY(void)
{
	return m_BasePositionY;
}

void ObjectInterface::Capture(void)
{
	m_ReferenceCount++;
}

void ObjectInterface::Release(void)
{
	m_ReferenceCount--;

	if( m_ReferenceCount <= 0 )
	{
		delete this;
	}
}